<template>
    <div class="app-container">
        <el-form :model="queryParams" ref="queryForm" :rules="rules" size="small" :inline="true" label-width="150px">
            <el-form-item label="手机号">
                <span>{{ kztel }}</span>
            </el-form-item>
            <el-form-item label="客资是否有效">
                <el-radio-group v-model="queryParams.type">
                    <el-radio :label="1">有效</el-radio>
                    <el-radio :label="0">无效</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="备注" prop="remark" v-if="queryParams.type == '0'">
                <el-select v-model="queryParams.remark" placeholder="请输入备注信息" clearable style="width: 180px">
                    <el-option v-for="dict in remark" :key="dict.key" :label="dict.label" :value="dict.label" />
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" size="mini" @click="shenhe(queryParams)">提交审核
                </el-button>
            </el-form-item>
        </el-form>
    </div>
</template>
<script>
import { youxiaoshenhe } from "@/api/kuser/allkz.js";

export default {
    data() {
        return {
            show: false,
            remark: [{
                key: 1,
                label: '电话号空号,微信不存在'
            }, {
                key: 2,
                label: '直接告知不需要'
            }, {
                key: 3,
                label: '帮朋友咨询或朋友定好了不需要了'
            }, {
                key: 4,
                label: '之前在某店订过'
            }, {
                key: 5,
                label: '市调的'
            }, {
                key: 6,
                label: '谈合作的'
            }, {
                key: 7,
                label: '3天内联系不上的'
            }, {
                key: 8,
                label: '其他'
            }, {
                key: 9,
                label: '重复'
            }],
            queryParams: {
                type: 1,
                remark: '',
                kzid: this.$route.query.kzid,
            },
            kztel: this.$route.query.kztel,
            rules: {}
        }
    },
    methods: {
        // 审核
        shenhe(queryParams) {
            youxiaoshenhe(queryParams).then(response => {
                if (this.queryParams.type == 1) {

                    this.$router.push({
                        name: 'kzfenpeishangjia',
                        query: { kzid: this.queryParams.kzid, wantcity: '', servetype: '', }
                    })
                } else if (this.queryParams.remark == '') {

                    this.$modal.msgWarning('请输入备注信息')
                } else if (this.queryParams.type == 0 && this.queryParams.remark != '') {
                    this.$router.push({
                        path: '/kuser/allkz',
                    })
                }
            })
        }
    }
}
</script>